#include "MQSortFilterProxyModel.h"

#include "Connection.h"
MQSortFilterProxyModel::MQSortFilterProxyModel(QObject *parent)
    : QSortFilterProxyModel(parent) {}

QVariant MQSortFilterProxyModel::data(const QModelIndex &index,
                                      int role) const {
  if (!index.isValid()) return QVariant();

  if (role == Qt::TextAlignmentRole) {
    int col = index.column();
    switch (col) {
      case BkId:
      case BkAvail:
      case BkStore:
      case BkTotal:
      case BkPrice:
        return Qt::AlignCenter;
    }
  }

  return this->sourceModel()->data(index, role);
}
